php forum
php mysql forum
php mysql smarty
 
Topic Options
#317183 - 06/09/08 09:01 AM [7.3] Dissallow quotes more then 3 levels deep
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
UBB 7.3 kinda has a bug that I was happy with, you can't quote so deep.

I made some code that checks for the quote level, and gives an error if you quote more then 3 levels deep.

open /scripts/addpost.inc.php

find:
Code:
	// -------------------------------------
	// Make sure there is a subject and body


add above:

Code:
	// ---------------------
	// Check maximum quote level

	unset($total);
	preg_match_all('%(\[quote=.+?\]|\[quote\]|\[/quote\])%', $Body, $result, PREG_PATTERN_ORDER);
	for ($i = 0; $i < count($result[0]); $i++) {
		$total .= $result[0][$i];
	}
	if (preg_match('%(\[/quote\]){4,}%', $total)) {
		$html -> not_right($ubbt_lang['MAX_QUOTE']);
	};


open /languages/english/addpost.php (plus every other language you might have)

find
Code:
$ubbt_lang['VIEW_POST'] = "View your post.";


add below:
Code:
$ubbt_lang['MAX_QUOTE'] = "For readability you can only quote messages 3 levels deep. Please edit your message and try again.";


The 3 levels deep is hardcoded in the regex, so if you want to change it, change the regex.


Edited by blaaskaak (08/01/08 02:33 AM)
Edit Reason: update
_________________________

Top
#317201 - 06/11/08 09:16 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Interesting smile Does your forum have issues with it? I understand there's a bug, but does your users actually exploit it? smile
_________________________
- Allen wavey
- What Drives You?

Top
#317203 - 06/11/08 10:25 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Well, issues...

Some users just hit quote, type their reply and that's it. If a couple users do that, imho it looks butt-ugly laugh over 5-6 quotes deep make little to no sense to me conversation wise.

SD can testify that I played with quote in quote regexes before. It's just that UBB's bug sort of made us tell the members "it is forbidden from now on to quote so deep".
_________________________

Top
#317207 - 06/11/08 11:33 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Understand - I use the quickreply mostly, rarely the quote smile
_________________________
- Allen wavey
- What Drives You?

Top
#317209 - 06/11/08 12:22 PM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
Originally Posted By: AllenAyres
Understand - I use the quickreply mostly, rarely the quote smile


i'm a quick/quote kinda guy.. and we need to fix the quote bug too smile
_________________________

Top
#317472 - 08/01/08 02:35 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
First post is updated, the regex originally posted gave some false positives if you would have 7+ normal quotes in a message.

Thanks to SD for helping thinking this new construction up.
_________________________

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks